Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Redshift Append #539

Merged
merged 7 commits into from
May 2, 2024
Merged

Refactor Redshift Append #539

merged 7 commits into from
May 2, 2024

Conversation

Tang8330
Copy link
Contributor

@Tang8330 Tang8330 commented May 2, 2024

Changes

Instead of creating a separate staging table and then running ALTER TABLE APPEND, we can just directly load this data into the Redshift table.

By doing this, we don't have to worry about the edge cases of ALTER TABLE APPEND like having distribution mode clashes.

@Tang8330 Tang8330 marked this pull request as ready for review May 2, 2024 01:23
@Tang8330 Tang8330 requested a review from nathan-artie May 2, 2024 01:23
@Tang8330
Copy link
Contributor Author

Tang8330 commented May 2, 2024

@nathan-artie This unblocks the append mode for reader. We just need to rewrite the dedupe query and we can enable it for Redshift deploys.

fmt.Sprintf(`ALTER TABLE %s APPEND FROM %s;`, tableID.FullyQualifiedName(), temporaryTableID.FullyQualifiedName()),
)
return err
return shared.Append(s, tableData, types.AppendOpts{TempTableID: tableID})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment outdated now:

// Redshift then has a separate step after `shared.Append(...)` to merge the two tables together.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is. I'm removing that whole option

@Tang8330 Tang8330 merged commit e45f3f8 into master May 2, 2024
1 check passed
@Tang8330 Tang8330 deleted the redshift-history-mode branch May 2, 2024 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants